package com.dingreading.cloud.admin.service.impl;

import com.dingreading.cloud.admin.entity.RequestLog2025;
import com.dingreading.cloud.admin.entity.table.RequestLog2025TableDef;
import com.dingreading.cloud.admin.mapper.RequestLog2025Mapper;
import com.dingreading.cloud.admin.service.RequestLog2025Service;
import com.dingreading.cloud.common.util.QueryFiledUtil;
import com.mybatisflex.core.query.QueryCondition;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  服务层实现。
 *
 * @author EDY
 * @since 2025-10-24
 */
@Service
public class RequestLog2025ServiceImpl extends BaseServiceImpl<RequestLog2025Mapper, RequestLog2025, RequestLog2025TableDef> implements RequestLog2025Service {

    @Override
    protected RequestLog2025TableDef getTable() {
        return RequestLog2025TableDef.requestLog2025;
    }

    @Override
    public List<RequestLog2025> getByDate(String beginDate, String endDate) {
        String requestUrl = "front/subjectLesson/getById";
        QueryCondition condition = QueryCondition.createEmpty()
                .and(table.requestUrl.like(requestUrl))
                .and(table.addTime.between(QueryFiledUtil.appendMin00(beginDate), QueryFiledUtil.appendMin24(endDate)));
        return getMapper().selectListByCondition(condition);
    }
}
